from passlib.context import CryptContext

# 创建密码上下文，指定bcrypt算法
pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")

# 定义函数进行密码哈希


def hash_password(password: str) -> str:
    return pwd_context.hash(password)


# 示例密码
password = "MobotStone"
hashed_password = hash_password(password)

print("原始密码:", password)
print("哈希化后的密码:", hashed_password)
